找传奇、传世资源到传世资源站!

html抽奖程序 示例源码下载

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

html抽奖程序 示例源码下载 HTML/CSS-第1张<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Language" content="zh-CN"/> <title>抽奖活动</title> <style type="text/css"> body {padding-top:100px;font:12px "\5B8B\4F53",sans-serif;text-align:center;} .result_box {margin:0 auto;width:700px;padding:100px 0;text-align:center;border:3px solid #40AA53;background:#efe;} .result_box #oknum {width:700px;color:#cc0000;font-size:50pt;font-family:Verdana;text-align:center;border:none;background:#efe;} .button_box {margin:50px 0 0 0;} .button_box .btn {cursor:pointer;padding:0 30px;margin:0 10px;color:#555;font-family:"\5B8B\4F53",sans-serif;font-size:40px;} </style> </head> <body> <script type="text/javascript"> //抽奖数据,以英文逗号分隔 var alldata = "001李大,002二,003邓三,004罗四,005欧五,006周六,007陈七,008潘八,009张九,010林十,011朱十一,012赵十二,013陈十三,014王十四"; var alldataarr = alldata.split(","); var num = alldataarr.length-1; var timer; function change(){ document.getElementById("oknum").value = alldataarr[GetRnd(0,num)]; } function start(){ clearInterval(timer); timer = setInterval('change()',46); //随机数据变换速度,越小变换的越快 } function ok(){ clearInterval(timer); //以下代码表示获得奖的,不能再获奖了。 重置刷新页面即可。 alldata = alldata.replace(document.getElementById("oknum").value,"").replace(",,",","); // 去掉前置,最末尾的, if (alldata.substr(0,1)==",") { alldata = alldata.substr(1,alldata.length); } if (alldata.substr(alldata.length-1,1)==",") { alldata = alldata.substring(0,alldata.length-1); } alldataarr = alldata.split(","); num = alldataarr.length-1; } function GetRnd(min,max){ return parseInt(Math.random()*(max-min 1)); }</script> <div class="result_box"><input type="text" id="oknum" name="oknum" value="抽奖结果" /></div> <script type="text/javascript"> window.onload = function() { showA(); } function showA() { document.getElementById("oknum").innerHTML="<a href=#>生成的内容1</a>"; }</script> <div class="button_box"><button class="btn" onclick="start()" accesskey="s">开始(<U>S</U>)</button><button class="btn" onclick="ok()" accesskey="o">停止(<U>O</U>)</button></div> </html>

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复